package com.ruicar.afs.cloud.finance.common.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruicar.afs.cloud.common.modules.contract.enums.FundsTypeEnum;
import com.ruicar.afs.cloud.common.modules.contract.enums.UnusedFundsStatusEnums;
import io.swagger.annotations.ApiModelProperty;
import lombok.experimental.Accessors;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author: Lee
 * @date 2020-05-29 06:41:48 
 * @description 客户待分配款项表
 */
@Data
@Accessors(chain = true)
@TableName(value ="finance_cust_unused_funds", autoResultMap = true)
public class FinanceCustUnusedFunds {
	@ApiModelProperty("唯一标识")
	@JsonSerialize(
			using = ToStringSerializer.class
	)
	@JSONField(
			serializeUsing = com.alibaba.fastjson.serializer.ToStringSerializer.class
	)
	@TableId(
			value = "id",
			type = IdType.ASSIGN_ID
	)
	private Long id;
	/** 虚拟账户id */
	private Long accountId ;
	/** 合同号码 */
	private String contractNo ;
	/** 类型;枚举值：分配后结余，撤销后暂存 */
	private FundsTypeEnum fundsType ;
	/** 收据id;撤销后暂存类型的为撤销前的收据id */
	private Long fundId ;
	/** 金额 */
	private BigDecimal amount ;
	/** 状态;枚举值：可分配(可用)，不可分配(状态锁定，不可用) */
	private UnusedFundsStatusEnums status ;
	/**  乐观锁 by ZC.GUO  **/
	private Long revision;

	@ApiModelProperty("创建者")
	@TableField(
			fill = FieldFill.INSERT
	)
	private String createBy;
	@JsonFormat(
			timezone = "GMT+8",
			pattern = "yyyy-MM-dd HH:mm:ss"
	)
	@DateTimeFormat(
			pattern = "yyyy-MM-dd HH:mm:ss"
	)
	@ApiModelProperty("创建时间")
	@TableField(
			fill = FieldFill.INSERT
	)
	private Date createTime;
	@ApiModelProperty("更新者")
	@TableField(
			fill = FieldFill.UPDATE
	)
	private String updateBy;
	@JsonFormat(
			timezone = "GMT+8",
			pattern = "yyyy-MM-dd HH:mm:ss"
	)
	@DateTimeFormat(
			pattern = "yyyy-MM-dd HH:mm:ss"
	)
	@ApiModelProperty("更新时间")
	@TableField(
			fill = FieldFill.UPDATE
	)
	private Date updateTime;

}
